<?php
declare(strict_types=1);

namespace app\admin\listener\user;

use app\admin\service\LoginLogService;

/**
 * 用户登录事件
 */
class UserLogin
{
    public function handle($event)
    {
        list($user, $time, $ip) = $event;
        LoginLogService::save([
            'login_time'     => $time,
            'ip'             => $ip,
            'user_id'        => $user['user_id']
        ]);
    }
}